package com.nbgroup.service;

import com.nbgroup.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/*  
 *   
 * @author 王玉涛  
 * @Date 2018/8/14 9:32  
 * @param   
 * @return   
 */ 
@Service
public class UserService implements UserDetailsService {

    @Autowired
    private UserDao userDao;
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return userDao.findByUsernameAndSts(username,"1");
    }
}
